﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using com.ClickCricket.dal;

/// <summary>
/// Summary description for PlayerDetailService
/// </summary>
/// 
namespace com.ClickCricket.bll
{
    public class PlayerDetailService
    {
        private static PlayerDetailService instance;

        public static PlayerDetailService Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new PlayerDetailService();
                }
                return instance;
            }
        }

        private readonly IPlayerDetailProvider playerDetailProvider;

        public PlayerDetailService(IPlayerDetailProvider playerDetailProvider)
        {
            this.playerDetailProvider = playerDetailProvider;
        }


        public PlayerDetail getPlayerDetails(int playerID)
        {
            return playerDetailProvider.getPlayerDetails(playerID);
        }

        public PlayerDetailService()
            : this(new PlayerDetailLinqProvider())
        {
            //
            // TODO: Add constructor logic here
            //
        }
    }
}
